import docker
def select_in():
    print("请选择菜单")
def errors():
    print("长点心啊,选错了\n")
admins = input("[1]镜像管理\n[2]容器管理\n")
if admins == "1":
    select_in()
    use = input("[1]查看镜像列表\n[2]查看单一镜像信息\n[3]删除镜像TAG\n[4]删除镜像\n[5]拉取镜像\n")
    image = docker.images()
    if use == "1":
        image.lists()
    elif use == "2":
        image.info("ecntos")
    elif use == "3":
        image.rmi()
    elif use == "4":
        image.rmi()
    elif use == "5":
        image.pull()
    else:
        errors()
elif admins == "2":
    select_in()
    use = input("[1]查看容器列表\n[2]查看容器信息\n[3]删除容器\n[4]创建容器\n")
    container = docker.containers()
    if use == "1":
        inf = input("[1]查看所有容器列表\n")
        # container.show()
    elif use == "2":
        print("pass")
        # container.info()
    elif use == "3":
        select_in()
        rm = input("[1]通过容器ID/名称删除\n[2]删除所有退出状态的容器\n[3]删除所有运行中的容器\n[4]删除所有容器\n")
    elif use == "4":
        print(container.create(id_name='centos'))
    else:
        errors()
else:
    errors()